package com.serviportales.serviquality.model;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.serviportales.serviportales.model.GenericEntity;
import com.serviportales.serviquality.model.pk.PlantillaNodoPK;

@Entity
@Table(name = "TSQ_PLANTILLA_NODO")
public class PlantillaNodo extends GenericEntity<PlantillaNodo> {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private PlantillaNodoPK plantillaNodoPK = new PlantillaNodoPK();

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({ @JoinColumn(name = "CDNODO_PARENT", referencedColumnName = "CDNODO"), @JoinColumn(name = "CDTIPO_NODO_PARENT", referencedColumnName = "CDTIPO_NODO"), @JoinColumn(name = "CDARBOL_PARENT", referencedColumnName = "CDARBOL") })
	private PlantillaNodo parent;

	public PlantillaNodoPK getPlantillaNodoPK() {
		return plantillaNodoPK;
	}

	public void setPlantillaNodoPK(PlantillaNodoPK plantillaNodoPK) {
		this.plantillaNodoPK = plantillaNodoPK;
	}

	public PlantillaNodo getParent() {
		return parent;
	}

	public void setParent(PlantillaNodo parent) {
		this.parent = parent;
	}
}
